﻿using System.Windows;
using System.Windows.Controls;
using Microsoft.Practices.Composite.Presentation.Commands;

namespace Core.Infrastructure.CommandExtensions
{
    public class CheckBoxCheckedCommandBehavior : CommandBehaviorBase<CheckBox>
    {
        public CheckBoxCheckedCommandBehavior(CheckBox targetObject)
            : base(targetObject)
        {
            targetObject.Checked += new RoutedEventHandler(TargetObjectChecked);
        }

        void TargetObjectChecked(object sender, RoutedEventArgs e)
        {
            base.ExecuteCommand();
        }
    }
}
